<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件中的数据存放</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <cpn></cpn>
</div>
<template id="cpn">
    <div>
        <h1>组建中的数据存放，放在实例化的data里，且必须是个函数</h1>
        <h2>标题：{{title}}</h2>
    </div>
</template>
<script src="../../js/vue.js"></script>
<script>
    Vue.component('cpn', {
        template: "#cpn",
        data() {
            return {
                title: "我是傻逼",
            }
        }
    })
    new Vue({
        el: "#app",
        data: {
            message: "你好，世界",
        }
    })
</script>
</body>
</html>